<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<link href="css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">					<!-- zTree CSS函式庫 -->
<link href="css/redmond/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css">	<!-- jquery UI CSS函式庫 -->
<link href="css/selfTemplate.css" rel="stylesheet" type="text/css">							<!-- 自建CSS函式庫 -->

<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>								<!-- jquery 函式庫 -->
<script src="js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>					<!-- jquery UI 函式庫 -->
<script src="js/jquery.cookie.js" type="text/javascript"></script>								<!-- 操做cookie用 -->
<script src="js/jquery.ztree.core-3.5.min.js" type="text/javascript"></script>						<!-- zTree 的核心函式庫，選擇SVN用 -->
<script src="js/jquery.ztree.excheck-3.5.min.js" type="text/javascript"></script>				<!-- zTree 的延伸函式庫，選擇SVN用 -->
<script src="js/widgets.js" type="text/javascript"></script>									<!-- 自建函式庫 -->


<style type="text/css">
	div#mainDiv {
		width: 95%; 
		padding-top:20px;
		padding-buttom:20px; 
		padding-right:20px;
		padding-left:15px; 
		
	}
</style>

<script type="text/javascript">



$(document).ready(function(){
	
	init("QueryChkInHistory.html");
	
	
	$("#btnSubmit").bind("click", function(){
		clearErrorMsg();
	/* 	windowFreeze();
		 */
		$.ajax({ type:'post',url:"QueryChkInRecord",dataType:'json',async:false,
			success : function(reses) {
				if ( reses.length > 0 ) {
					$("#queResRoot").html("<table id='tableQueryChkInRecord'><thead class='tableFirst'><tr><td class='right' colspan='142'><a href='GenQueryChkInhisReport' class='fileDownloadPromise'>下載查詢結果</a></td></tr><tr><th>#</th><th>繳交記錄ID</th><th>子系統</th><th>繳交人員</th><th>繳交日期</th><th>現場版</th><th>SVN CM<br>原始碼版次</th><th>SVN AP<br>MR版次</th><th>SVN AP<br>OL版次</th><th>#</th><th>繳交模組</th><th>MR<br>繳交數</th><th>OL<br>繳交數</th><th>部署檔</th><th>部署檔版次</th><th>流程進度</th></tr><tbody id='tbodyQueryChkInRecord'></tbody></table>");
					var trn = 0;	//一筆繳交紀錄會含多少 <tr>
					$.each(reses, function(i, r1){
						var idx = i+1;
						var bgc = (i%2==0)?"white":"#EAF4FD";
						var r = r1.rsp;
						var tmp = "<tr bgcolor='"+bgc+"'><td class='int' rowspan='"+r+"'>"+idx+"</td><td class='int' rowspan='"+r+"'>"+r1.chkInId+"</td><td rowspan='"+r+"'>"+r1.subsysDesc+"("+r1.subsysId+")</td><td rowspan='"+r+"'>"+r1.creatorName+"</td><td rowspan='"+r+"'>"+r1.cDT+"</td><td class='center' rowspan='"+r+"'>"+((!r1.isMR)?"是":"否")+"</td><td class='int' rowspan='"+r+"'>"+r1.svnCMver+"</td><td class='int' rowspan='"+r+"'>"+r1.svnAPmrVer+"</td><td class='int' rowspan='"+r+"'>"+r1.svnAPolVer+"</td><td class='int'>1</td><td>"+r1.modId+"</td><td class='int'>"+r1.mrCount+"</td><td class='int'>"+r1.olCount+"</td><td>"+r1.depFile+"</td><td class='int'>"+r1.svnCMcapVer+"</td><td>"+r1.statusDesc+"</td><td></td></tr>";
						$("#tbodyQueryChkInRecord").append(tmp);
						
						$.each(r1.c2s, function(j, r2){
							tmp = "<tr bgcolor='"+bgc+"'><td class='int'>"+(j+2)+"</td><td>"+r2.modId+"</td><td class='int'>"+r2.mrCount+"</td><td class='int'>"+r2.olCount+"</td><td>"+r2.depFile+"</td><td class='int'>"+r2.svnCMcapVer+"</td><td>"+r2.statusDesc+"</td><td></td></tr>";
							$("#tbodyQueryChkInRecord").append(tmp);
						});
					});
					
				} else {
					$("#queResRoot").html("");
					$("#errShortMsg").html("沒有查詢到結果");
				}
			}, error : function(xhr, ajaxOptions, thrownError) { errorAjx(xhr); }
		});
		
/* 		windowUnfreeze(); */
	});
	
	$("button").button();
});

</script>
</head>
<body>
	<div id="header"></div>		<!-- 畫面抬頭 -->

	<div id="mainDiv" >
		<table id="tableQueryCriDepMemphis">
			<thead class="tableFirst">
				<!-- <tr><th class="right">預設查詢天數</th><td><input size="2" class="int" value="15" type="text" id="queryInterval" />天內</td></tr> -->
				<tr><td class="center" colspan="2"><button id="btnSubmit" type="button">送出</button></td></tr>
				<tr><td colspan="2">&nbsp;</td></tr>
			</thead>
		</table>
		<p>
		<div id="queResRoot"></div>
	</div>
	<p><p>
</body>
</html>